import request from "@/utils/request";
//获取管理员列表数据接口
export const getuserList = params => {
  return request({
    url: "permission/user",
    method: "get",
    params
  });
};

//删除管理员接口
export const deluserItem = id => {
  return request({
    url: `/permission/user/${id}`,
    method: "delete"
  });
};

// 获取角色列表
export const getrole = () => {
  return request({
    url: "/permission/role"
  });
};

//添加角色
export const adduserItem = data => {
  return request({
    url: "permission/user",
    method: "post",
    data
  });
};

//获取角色
export const getuserItem = id => {
  return request({
    url: `/permission/user/${id}`
  });
};

//编辑角色
export const edituserItem = data => {
  return request({
    url: `/permission/user/${data.id}`,
    method: "put",
    data
  });
};

//切换按钮

export const toggleButton = data => {
  return request({
    url: `/permission/user/${data.id}/${data.status}`,
    method: "get",
  });
};


//上传图片
//上传头像
export const addphone = data =>{
  return request({
    url:`/index/upload/?mode=base64&type=image`,
    method:'POST',
    data,
  })
}